<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/4/20 0020
 * Time: 20:00
 */

namespace backend\controllers;
use common\models\Cooperate;
use yii\web\Controller;
use Yii;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;

class CooperateController extends Controller
{

    public function behaviors()
    {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['POST'],
                ],
            ],

            'access' =>[
                'class' => AccessControl::className(),
                'rules' =>
                    [
                        [
                            'actions' => [ ],
                            'allow' => true,
                            'roles' => ['@'],
                        ],
                        [
                            'actions' => ['view', 'index', 'create','update'],
                            'allow' => true,
                            'roles' => ['@'],
                        ],
                    ],
            ],
        ];
    }
    public function actionIndex()
    {
        $searchModel = new Cooperate();

        $dataProvider = $searchModel->search(YII::$app->request->get());
        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }



}